def loop(x):
    return str(x) == str(x)[::-1]


def palindrome_numbers(a, b):
    for num in range(a, b + 1):
        if num % 2 == 0 and loop(num):
            print(num)


a, b = map(int, input().split())

palindrome_numbers(a, b)

